<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>登录</title>
    <link rel="stylesheet" href="css/index.css">
<!--    <link rel="stylesheet" href="css/layui.css.css">-->
</head>
<body class="login_body">
<div class="cont">
    <div class="box">登录</div>
<!--    弹出层-->
    <div class="container">
        <div class="conent">
            <div class="x">X</div>
            <form action="">
                <p>欢迎登录</p>
                <input type="text" id="userName" name="userName" placeholder="请输入您的用户名" class="input ip1"><br>
                <input type="password" id="passWord" name="passWord" placeholder="请输入您的密码" class="input"><br>
                <div class="cont-mm">
                    <label><input type="checkbox" name="checkbox" id="">记住密码</label>
                    <p>忘记密码?</p>
                </div>
                <button class="button" onclick="login()"><a href="#">安全登录</a></button>
            </form>

        </div>
    </div>
</div>

</body>
<!--<script src="js/layui.js.js"></script>-->
<script src="js/jquery.min.js"></script>
<!--<script src="js/login.js"></script>-->
<script type="text/javascript">
	
	var ctx =  "http://localhost/web/user"
	
    $(function () {
        $('.box').click(function () {
            $('.container').show();
            $('.box').hide();
        })
        $('.x').click(function () {
            $('.container').hide();
            $('.box').show();
        })
    })
	
	function login(){
		
		$.ajax({
			url:ctx + "/login",
			data:{
				loginName:$("#userName").val(),
				password:$("#passWord").val()
			},
			type:"post",
			dataType:"JSON",
			success:function(res){
				console.log(res);
			}
		})
		
	}

    // 存储数据
    $('.yulan').click(function () {
        var cont = $('#container').html();
        window.open("yulan.html");
        window.localStorage.setItem('cont', cont);
    })

</script>
</html>